/*
  组件命名规则：大驼峰, 有明确层级关系。 示例：HelloWord.vue
  URL命名规则：一律小写，表现出层级关系
  meta中bread字段用以标注面包屑中的内容。多层关系用逗号分开。示例：bread:['个人中心','个人信息']  必填项
*/

import Home from '../pages/Home.vue'
import routerGlobal from './router-global.js' // 全局路由
// import routerBasic from './router-basic.js' // 基础模块路由
// import routerPages from './router-pages' // 项目业务路由
import InvoiceRegistrationRoutes from './invoiceRegistration' // 发票登记系统
import specialFundsRoutes from './specialFundsRoutes' // 专项经费
import performanceRoutes from './performanceRoutes' // 绩效考核
import budgetManagement from './budgetManagement' // 预算成本考核

const routerList = [
  {
    path: '/',
    name: 'home',
    component: Home,
    redirect: '/index',
    meta: {
      title: '首页'
    },
    children: [
      {
        path: '/index',
        name: 'index',
        meta: {
          text: '首页',
          bread: ['首页']
        },
        component: () => import('../pages/index/Index.vue')
      },
      /*
       ** 基础设置
       */

      // 核算单元
      {
        path: '/basic-setting/accounting-unit/dept',
        name: '科室字典',
        meta: {
          text: '科室字典',
          bread: ['基础设置', '科室字典']
        },
        component: () => import('../pages/basicSetting/accountingUnit/Dept.vue')
      },
      {
        path: '/basic-setting/accounting-unit/corres',
        name: '科室部门对应',
        meta: {
          text: '科室部门对应',
          bread: ['基础设置', '科室部门对应']
        },
        component: () =>
          import('../pages/basicSetting/accountingUnit/Corres.vue')
      },

      // 会计类目
      {
        path: '/basic-setting/accountant/project',
        name: '成本项目',
        meta: {
          text: '成本项目',
          bread: ['基础设置', '成本项目']
        },
        component: () => import('../pages/basicSetting/accountant/Project.vue')
      },
      {
        path: '/basic-setting/accountant/earning-project',
        name: '收入项目',
        meta: {
          text: '收入项目',
          bread: ['基础设置', '收入项目']
        },
        component: () =>
          import('../pages/basicSetting/accountant/EarningProject.vue')
      },
      {
        path: '/data-conversion/integration/roles',
        name: '多角色工作系数',
        meta: {
          text: '多角色工作系数',
          bread: ['基础设置', '多角色工作系数']
        },
        component: () => import('../pages/dataConversion/integration/Roles.vue')
      },
      {
        path: '/data-conversion/integration/area',
        name: '房屋面积',
        meta: {
          text: '房屋面积',
          bread: ['基础设置', '房屋面积']
        },
        component: () => import('../pages/dataConversion/integration/Area.vue')
      },

      // 分摊设置
      {
        path: '/basic-setting/apportion/dept',
        name: '科室分摊',
        meta: {
          text: '科室分摊',
          bread: ['分摊设置', '科室分摊']
        },
        component: () => import('../pages/basicSetting/apportion/Dept.vue')
      },
      {
        path: '/basic-setting/apportion/direct',
        name: '定向分摊',
        meta: {
          text: '定向分摊',
          bread: ['分摊设置', '定向分摊']
        },
        component: () => import('../pages/basicSetting/apportion/Direct.vue')
      },
      {
        path: '/basic-setting/apportion/force',
        name: '强制分摊',
        meta: {
          text: '强制分摊',
          bread: ['分摊设置', '强制分摊']
        },
        component: () => import('../pages/basicSetting/apportion/Force.vue')
      },

      // 规则对照
      {
        path: '/data-conversion/rules/working-verification',
        name: '规则对照校验',
        meta: {
          text: '规则对照校验',
          bread: ['规则对照', '规则对照校验']
        },
        component: () =>
          import('../pages/dataConversion/rules/workingVerification.vue')
      },
      {
        path: '/data-conversion/rules/wage',
        name: '科室-工资对应',
        meta: {
          text: '科室-工资对应',
          bread: ['规则对照', '科室-工资对应']
        },
        component: () => import('../pages/dataConversion/rules/Wage.vue')
      },
      {
        path: '/data-conversion/rules/HIS',
        name: '科室-HIS科室',
        meta: {
          text: '科室-HIS科室',
          bread: ['规则对照', '科室-HIS科室']
        },
        component: () => import('../pages/dataConversion/rules/HIS.vue')
      },
      {
        path: '/data-conversion/rules/yydept',
        name: '科室-用友科室',
        meta: {
          text: '科室-用友科室',
          bread: ['规则对照', '科室-用友科室']
        },
        component: () => import('../pages/dataConversion/rules/YyDept.vue')
      },
      {
        path: '/data-conversion/rules/yysystem',
        name: '成本-用友系统',
        meta: {
          text: '成本-用友系统',
          bread: ['规则对照', '成本-用友系统']
        },
        component: () => import('../pages/dataConversion/rules/YySystem.vue')
      },

      {
        path: '/data-conversion/rules/payment',
        name: '成本-薪酬系统',
        meta: {
          text: '成本-薪酬系统',
          bread: ['规则对照', '成本-薪酬系统']
        },
        component: () => import('../pages/dataConversion/rules/Payment.vue')
      },
      {
        path: '/data-conversion/rules/sryySysterm',
        name: '收入-用友系统',
        meta: {
          text: '收入-用友系统',
          bread: ['规则对照', '收入-用友系统']
        },
        component: () => import('../pages/dataConversion/rules/sryySysterm.vue')
      },
      // 收支数据
      {
        path: '/data-conversion/change/collection',
        name: '收支采集',
        meta: {
          text: '收支采集',
          bread: ['数据交换', '数据转换', '收支采集']
        },
        component: () => import('../pages/dataConversion/change/inOutCaiji.vue')
      },

      {
        path: '/data-conversion/change/earning',
        name: '收入数据',
        meta: {
          text: '收入数据',
          bread: ['数据交换', '数据转换', '收入数据']
        },
        component: () => import('../pages/dataConversion/change/Earning.vue')
      },

      {
        path: '/data-conversion/change/cost-data',
        name: '成本数据',
        meta: {
          text: '成本数据',
          bread: ['数据交换', '数据转换', '成本数据']
        },
        component: () => import('../pages/dataConversion/change/CostData.vue')
      },
      {
        path: '/data-conversion/change/cost-adjust',
        name: '成本调整',
        meta: {
          text: '成本调整',
          bread: ['数据交换', '数据转换', '成本调整']
        },
        component: () => import('../pages/dataConversion/change/CostAdjust.vue')
      },
      /*
       ** 数据核算
       */

      // 成本分摊
      {
        path: '/accounting-data/cost',
        name: '成本分摊',
        meta: {
          text: '成本分摊',
          bread: ['数据核算', '成本分摊']
        },
        component: () => import('../pages/accountingData/Cost.vue')
      },

      // 分摊校验
      {
        path: '/accounting-data/check',
        name: '分摊校验',
        meta: {
          text: '分摊校验',
          bread: ['数据核算', '分摊校验']
        },
        component: () => import('../pages/accountingData/Check.vue')
      },

      // 成本综合查询
      {
        path: '/accounting-data/query',
        name: '成本综合查询',
        meta: {
          text: '成本综合查询',
          bread: ['数据核算', '成本综合查询']
        },
        component: () => import('../pages/accountingData/Query.vue')
      },

      // 成本校验
      {
        path: '/accounting-data/efficacy/prepare',
        name: '分摊准备工作校验',
        meta: {
          text: '分摊准备工作校验',
          bread: ['数据核算', '成本校验', '分摊准备工作校验']
        },
        component: () => import('../pages/accountingData/efficacy/Prepare.vue')
      },
      {
        path: '/accounting-data/efficacy/total-cost',
        name: '财务总成本核对',
        meta: {
          text: '财务总成本核对',
          bread: ['数据核算', '成本校验', '财务总成本核对']
        },
        component: () =>
          import('../pages/accountingData/efficacy/TotalCost.vue')
      },
      {
        path: '/accounting-data/efficacy/lasting-dept',
        name: '末级科室校验',
        meta: {
          text: '末级科室校验',
          bread: ['数据核算', '成本校验', '末级科室校验']
        },
        component: () =>
          import('../pages/accountingData/efficacy/LastingDept.vue')
      },
      {
        path: '/accounting-data/efficacy/dealings-dept',
        name: '往来科室校验',
        meta: {
          text: '往来科室校验',
          bread: ['数据核算', '成本校验', '往来科室校验']
        },
        component: () =>
          import('../pages/accountingData/efficacy/DealingsDept.vue')
      },
      {
        path: '/accounting-data/efficacy/particulars',
        name: '明细数据校验',
        meta: {
          text: '明细数据校验',
          bread: ['数据核算', '成本校验', '明细数据校验']
        },
        component: () =>
          import('../pages/accountingData/efficacy/Particulars.vue')
      },
      /*
       ** 成本分析报表
       */

      // 医院各科室单月直接成本表
      {
        path: '/analysis-report/per-month',
        name: '医院各科室单月直接成本表',
        meta: {
          text: '医院各科室单月直接成本表',
          bread: ['成本分析报表', '医院各科室单月直接成本表']
        },
        component: () => import('../pages/analysisReport/PerMonth.vue')
      },
      // 医院临床服务类科室全成本表
      {
        path: '/analysis-report/clinic-cost',
        name: '医院临床服务类科室全成本表',
        meta: {
          text: '医院临床服务类科室全成本表',
          bread: ['成本分析报表', '医院临床服务类科室全成本表']
        },
        component: () => import('../pages/analysisReport/ClinicCost.vue')
      },
      // 医院临床服务类科室全成本构成分析表
      {
        path: '/analysis-report/clinic-constitute',
        name: '医院临床服务类科室全成本构成分析表',
        meta: {
          text: '医院临床服务类科室全成本构成分析表',
          bread: ['成本分析报表', '医院临床服务类科室全成本构成分析表']
        },
        component: () => import('../pages/analysisReport/ClinicConstitute.vue')
      },
      // 医院收益总表（财政补贴）
      {
        path: '/analysis-report/grant-in-aid',
        name: '医院收益总表（财政补贴）',
        meta: {
          text: '医院收益总表（财政补贴）',
          bread: ['成本分析报表', '医院收益总表（财政补贴）']
        },
        component: () => import('../pages/analysisReport/GrantInAid.vue')
      },
      // 医院各科室直接成本表（按成本项目汇总）
      {
        path: '/analysis-report/direct-cost',
        name: '医院各科室直接成本表（按成本项目汇总）',
        meta: {
          text: '医院各科室直接成本表（按成本项目汇总）',
          bread: ['成本分析报表', '医院各科室直接成本表（按成本项目汇总）']
        },
        component: () => import('../pages/analysisReport/DirectCost.vue')
      },
      // 医院各科室全成本表（会计分类汇总）
      {
        path: '/analysis-report/total-cost',
        name: '各科室全成本表（会计分类汇总）',
        meta: {
          text: '各科室全成本表（会计分类汇总）',
          bread: ['成本分析报表', '各科室全成本表（会计分类汇总）']
        },
        component: () => import('../pages/analysisReport/TotalCost.vue')
      },
      // 核算科室收入成本汇总表（核算定义）
      {
        path: '/analysis-report/earning-cost',
        name: '核算科室收入成本汇总表（核算定义）',
        meta: {
          text: '核算科室收入成本汇总表（核算定义）',
          bread: ['成本分析报表', '核算科室收入成本汇总表（核算定义）']
        },
        component: () => import('../pages/analysisReport/EarningCost.vue')
      },
      // 核算科室收入成本汇总表（核算单元）
      {
        path: '/analysis-report/FTU',
        name: '核算科室收入成本汇总表（核算单元）',
        meta: {
          text: '核算科室收入成本汇总表（核算单元）',
          bread: ['成本分析报表', '核算科室收入成本汇总表（核算单元）']
        },
        component: () => import('../pages/analysisReport/FTU.vue')
      },
      // 各科室全成本表（会计分类汇总）
      {
        path: '/analysis-report/accountingSummary',
        name: '各科室全成本表（会计分类汇总）',
        meta: {
          text: '各科室全成本表（会计分类汇总）',
          bread: ['成本分析报表', '各科室全成本表（会计分类汇总）']
        },
        component: () => import('../pages/analysisReport/accountingSummary.vue')
      },
      // 业务科室收支汇总表
      {
        path: '/analysis-report/businessptSalarypament',
        name: '业务科室收支汇总表',
        meta: {
          text: '业务科室收支汇总表',
          bread: ['成本分析报表', '业务科室收支汇总表']
        },
        component: () =>
          import('../pages/analysisReport/businessptSalarypament.vue')
      },
      // 季度科室直接成本
      {
        path: '/analysis-report/quarter-dptCost',
        name: '季度科室直接成本',
        meta: {
          text: '季度科室直接成本',
          bread: ['成本分析报表', '季度科室直接成本']
        },
        component: () =>
          import('../pages/analysisReport/quarterdptCost.vue')
      },

      // 住院科室收支汇总表
      {
        path: '/analysis-report/hospitalDptSzSum',
        name: '住院科室收支汇总表',
        meta: {
          text: '住院科室收支汇总表',
          bread: ['成本分析报表', '住院科室收支汇总表']
        },
        component: () =>
          import('../pages/analysisReport/hospitalDptSzSum.vue')
      },

      /*
       ** 用户管理
       */

      // 用户管理
      {
        path: '/user-manager/user-manager',
        name: '用户管理',
        meta: {
          text: '用户管理',
          keepAlive: false,
          bread: ['用户管理', '用户管理']
        },
        component: () => import('../pages/userManager/UserManager.vue')
      },
      // 角色管理
      {
        path: '/user-manager/role-manager',
        name: '角色管理',
        meta: {
          text: '角色管理',
          bread: ['用户管理', '角色管理']
        },
        component: () => import('../pages/userManager/RoleManager.vue')
      },
      // 菜单管理
      {
        path: '/user-manager/menu-manager',
        name: '菜单管理',
        meta: {
          text: '菜单管理',
          bread: ['用户管理', '菜单管理']
        },
        component: () => import('../pages/userManager/menuManager.vue')
      },
      // 科室经营分析
      {
        path: '/deptDirector/comprehensive/dept',
        name: '科室经营分析',
        meta: {
          text: '科室经营分析',
          bread: ['科主任经营分析', '综合分析', '科室经营分析']
        },
        component: () => import('@/pages/deptDirectorAnalysis/deptManage.vue')
      },
      // 科室项目收入分析
      {
        path: '/deptDirector/salary/deptXm',
        name: '科室项目收入分析',
        meta: {
          text: '科室项目收入分析',
          bread: ['科主任经营分析', '收入分析', '科室项目收入分析']
        },
        component: () =>
          import('@/pages/deptDirectorAnalysis/deptXmJyAnalysis.vue')
      },
      //  收入分析
      {
        path: '/deptDirector/salary/deptSalary',
        name: '收入分析',
        meta: {
          text: '科室收入分析',
          bread: ['成本核算', '科主任经营分析', '收入分析']
        },
        component: () =>
          import('@/pages/deptDirectorAnalysis/deptIncomAnalysis.vue')
      },

      // 成本分析
      {
        path: '/deptDirector/cost/deptCb',
        name: '科室成本分析',
        meta: {
          text: '科室成本分析',
          bread: ['成本核算', '科主任经营分析', '成本分析']
        },
        component: () =>
          import('@/pages/deptDirectorAnalysis/deptCostAnalysis.vue')
      },
      // 科室固定资产查询
      {
        path: '/deptDirector/cost/deptFixed',
        name: '科室固定资产查询',
        meta: {
          text: '科室固定资产查询',
          bread: ['成本核算', '成本分析', '科室固定资产查询']
        },
        component: () =>
          import('@/pages/deptDirectorAnalysis/deptFixedGood.vue')
      },

      // 收益分析
      {
        path: '/deptDirector/profit/income',
        name: '收益分析',
        meta: {
          text: '收益分析',
          bread: ['成本核算', '科主任经营分析', '收益分析']
        },
        component: () =>
          import('@/pages/deptDirectorAnalysis/incomeAnalysis.vue')
      },
      // 保本点分析
      {
        path: '/deptDirector/breakeven/department',
        name: '保本点分析',
        meta: {
          text: '保本点分析',
          bread: ['成本核算', '科主任经营分析', '保本点分析']
        },
        component: () =>
          import('@/pages/deptDirectorAnalysis/breakevenDept.vue')
      },
      // 分录凭证
      {
        path: '/basic-setting/accvouch-work-load',
        name: '分录凭证',
        meta: {
          text: '分录凭证',
          bread: ['成本核算', '基础设置', '分录凭证']
        },
        component: () =>
          import('@/pages/basicSetting/accvouchWorkLoad/index.vue')
      },
      // 科主任基金期初设置
      {
        path: '/kzrfound/data-set',
        name: '科主任基金期初设置',
        meta: {
          text: '科主任基金期初设置',
          bread: ['成本核算', '科主任基金', '科主任基金期初设置']
        },
        component: () => import('@/pages/kzrFund/dataSet.vue')
      },
      // 科主任基金-数据采集
      {
        path: '/kzrfound/data-gather',
        name: '科主任基金数据采集',
        meta: {
          text: '科主任基金数据采集',
          bread: ['成本核算', '科主任基金', '科主任基金数据采集']
        },
        component: () => import('@/pages/kzrFund/dataGather.vue')
      },
      // 科主任基金-汇总
      {
        path: '/kzrfound/summary',
        name: '科主任基金汇总',
        meta: {
          text: '科主任基金汇总',
          bread: ['成本核算', '科主任基金', '科主任基金汇总']
        },
        component: () => import('@/pages/kzrFund/summary.vue')
      },
      // 系统设置-科主任基金科室数据汇总
      {
        path: '/kzrfound/dept-summary',
        name: '科主任基金科室数据汇总',
        meta: {
          text: '科主任基金科室数据汇总',
          bread: ['专项经费', '科主任基金科室数据汇总']
        },
        component: () => import('@/pages/kzrFund/deptSummary.vue')
      },
      // // 科主任基金-明细
      // {
      //   path: '/kzrfound/details',
      //   name: '科主任基金查询明细',
      //   meta: {
      //     text: '科主任基金查询明细',
      //     bread: ['成本核算', '科主任基金', '科主任基金查询明细']
      //   },
      //   component: () => import('@/pages/kzrFund/details.vue')
      // },

      ...InvoiceRegistrationRoutes,

      ...specialFundsRoutes,

      ...performanceRoutes,
      ...budgetManagement,

      {
        path: '/notfound',
        component: () => import('../globalPages/notfound/Index.vue')
      }
    ]
  },
  // 全局路由
  ...routerGlobal,
  {
    path: '/*',
    meta: {
      title: '404'
    },
    redirect: '/notfound'
  }
]

export default routerList
